package com.wei.xin12306.member.controller;

import com.wei.xin12306.member.entity.Member;
import com.wei.xin12306.member.service.MemberService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import java.util.List;

/**
 * @author wjx
 * @ClassName TestController
 * @description:
 * @date 2024-05-08 15:31
 * @version: 1.0
 */
@RestController
@RequestMapping("test")
public class TestController {

    @Autowired
    private MemberService memberService;

    @GetMapping("hello")
    public String hello(){
        System.out.println("llll");
        return "hello";
    }

    @PostMapping("test")
    public String test(){
        List<Member> list = memberService.list();
        boolean b = memberService.removeBatchByIds(list);
        return b ? "ok" : "fail";
    }


}
